package project1;

import project1.annotation.Step;

import java.lang.reflect.Method;

public class WorkStep {
	public static void exe(Class clazz, int... steps){
		Method[] methods = clazz.getDeclaredMethods();
		for(Method method : methods){
			Step step = method.getAnnotation(Step.class);
			if(step != null){
				for(int i : steps){
					if(step.step() == i){
						try {
							method.invoke(clazz.newInstance());
						} catch (Exception e) {
							e.printStackTrace();
						}
					}
				}
			}
		}
	}
}
